<?php
// src/Asiah/SiklusBundle/Entity/User.php
namespace Asiah\SiklusBundle\Entity;

use Symfony\Component\Security\Core\Role\RoleInterface;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="Asiah\SiklusBundle\Repository\RoleRepository")
 * @ORM\Table(name="role")
 */
class Role implements RoleInterface {

	public function __construct() {
		$this -> createdAt = new \DateTime();
	}

	/**
	 * Implementation of getRole for the RoleInterface.
	 *
	 * @return string The role.
	 */
	public function getRole() {
		return $this -> getName();
	}

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 *
	 * @var integer $id
	 */
	protected $id;

	/**
	 * @ORM\Column(type="string", length="255")
	 *
	 * @var string $name
	 */
	protected $name;

	/**
	 * @ORM\Column(type="datetime", name="created_at")
	 *
	 * @var DateTime $createdAt
	 */
	protected $createdAt;


	/**
	 * Get id
	 *
	 * @return integer 
	 */
	public function getId()
	{
		return $this->id;
	}

	/**
	 * Set name
	 *
	 * @param string $name
	 */
	public function setName($name)
	{
		$this->name = $name;
	}

	/**
	 * Get name
	 *
	 * @return string 
	 */
	public function getName()
	{
		return $this->name;
	}

	/**
	 * Set createdAt
	 *
	 * @param datetime $createdAt
	 */
	public function setCreatedAt($createdAt)
	{
		$this->createdAt = $createdAt;
	}

	/**
	 * Get createdAt
	 *
	 * @return datetime 
	 */
	public function getCreatedAt()
	{
		return $this->createdAt;
	}
}